﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Text;
/// <summary>
///rzcz 的摘要说明
/// </summary>
public class rzcz
{
  public rzcz()
  {
    //
    //TODO: 在此处添加构造函数逻辑
    //
  }

  public static DataSet GetRZ(string date1, string date2)
  {
    StringBuilder sbSql = new StringBuilder();
    sbSql.Append("select ROW_NUMBER() OVER (ORDER BY czsj desc,czr) AS xh,a.* from sys_xtcz a where a.czsj>=@0 and a.czsj<=cast(@1 as datetime) ");
    //sbSql.Append("order by cx_id desc");
    SqlParameter[] cmdParams = { new SqlParameter("@0", SqlDbType.VarChar, 10), new SqlParameter("@1", SqlDbType.VarChar, 10) };
    cmdParams[0].Value = date1;
    cmdParams[1].Value = date2;
    DataSet ds = DbHelperSQL.Query(sbSql.ToString(), cmdParams);
    return ds;
  }

  public static void InsertRZ(string cznr)
  {
    string sql = "insert into sys_xtcz values(@0,@1,@2)";
    SqlParameter[] cmdParams = { new SqlParameter("@0", SqlDbType.VarChar, 30), new SqlParameter("@1", SqlDbType.VarChar, 500),
                               new SqlParameter("@2", SqlDbType.VarChar, 20)};
    cmdParams[0].Value = DateTime.Now.ToString();
    cmdParams[1].Value = cznr;
    cmdParams[2].Value = SysManage.Get_User;
    DbHelperSQL.ExecuteSql(sql, cmdParams);
  }
}